]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Ignore events in SelectArea after making a selection
authorSebastian Keller <skeller@gnome.org>
Wed, 28 Apr 2021 05:15:03 +0000 (07:15 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 28 Apr 2021 11:40:19 +0000 (11:40 +0000)
The grab and actor are only removed after the selection rectangle has
finished fading out. During this time it was possible to still change
the position of the selection rectangle.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2761
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1825>

js/ui/screenshot.js

index e736c3f6c744d2d2a5ce423b9e637284623bd736..81ab516b171483c8f8300e58bea72b753218c500 100644 (file)
@@ -384,6 +384,9 @@ class SelectArea extends St.Widget {
     }
 
     vfunc_button_press_event(buttonEvent) {
+        if (this._result)
+            return Clutter.EVENT_PROPAGATE;
+
         [this._startX, this._startY] = [buttonEvent.x, buttonEvent.y];
         this._startX = Math.floor(this._startX);
         this._startY = Math.floor(this._startY);
@@ -393,7 +396,7 @@ class SelectArea extends St.Widget {
     }
 
     vfunc_button_release_event() {
-        if (this._startX === -1 || this._startY === -1)
+        if (this._startX === -1 || this._startY === -1 || this._result)
             return Clutter.EVENT_PROPAGATE;
 
         this._result = this._getGeometry();